package com.springinaction.soundsystem;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class DaoLogActive {
	
	@Pointcut("execution(* com.springinaction.soundsystem.CompactDisc.save(Object,String)) && args(obj,id)")
	public void daoLogActive(Object obj,String id){}
	
	@Before("daoLogActive(obj,id)")
	public void beforeSaveLog(Object obj,String id){
		System.out.println("before");
	}
	
	@After("daoLogActive(obj,id)")
	public void afterSaveLog(Object obj,String id){
		System.out.println("after");
	}
}
